import {MenuUnfoldOutlined, RightCircleOutlined} from '@ant-design/icons';
import {FloatButton} from 'antd';
import {useState} from "react";
import Lindex from "../pages/Lindex.tsx";
import Settings from "../pages/Settings.tsx";

function LFloatButton() {
    const [view, setView] = useState(<Lindex/>)

    function toSettings() {
        setView(<Settings/>)
    }

    return (
        <>
            <FloatButton.Group
                trigger="hover"
                type="primary"
                style={{right: 24}}
                icon={<MenuUnfoldOutlined/>}
            >
                <FloatButton onClick={toSettings}/>
                <FloatButton onClick={() => setView(<Lindex/>)} icon={<RightCircleOutlined/>}/>
            </FloatButton.Group>
            {view}
        </>
    )
}

export default LFloatButton;